import Head from "next/head";
import React from "react";

type PropsType = {
  title: string;
  children: JSX.Element | JSX.Element[];
  desc?: string;
};

const PageWrapper: React.FC<PropsType> = ({
  title = "新问卷",
  children,
  desc = "问卷调查 | 在线投票",
}) => {
  return (
    <>
      <Head>
        <title>{title}</title>
        <meta name="description" content={desc} />
        <meta
          name="viewport"
          content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"
        />
        <link rel="icon" href="/favicon.ico" />
      </Head>
      <main
        style={{
          maxWidth: "678px",
          margin: "0 auto",
          padding: "0 16px",
        }}
      >
        {children}
      </main>
    </>
  );
};

export default PageWrapper;
